<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title></title>
    </head>
<body>
    <div class="parent">
        <div id="test1">1</div>
        <div id="test2">2</div>
        <div id="test3">3</div>
    </div>
    
    <script>
        let test1 = document.getElementById("test1");
        let test2 = document.getElementById("test2");
        let parentNode = test1.parentNode;
        parentNode.insertBefore(test1,null);
    </script>
</body>
</html>